/**
 * Created by Moudi on 2017/3/10.
 */

.nav {
  z-index: 200;
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  transition: 0.7s;
  .animal-nav {
    position: absolute;
    top: 50%;
    right: 30px;
    margin-top: -115px;
    z-index: 1;
    .next .arrow {
      transform: translateX(-6px);
      &::after {
        transform: rotate(45deg);
      }
      &::before {
        transform: rotate(-45deg) translateX(8px) translateY(8px);
      }
    }
    .nav-btn {
      display: block;
      left: 50%;
      margin-left: -27px;
    }
    li {
      transition: .23s;
    }
    li:nth-child(2) {
      transition-delay: .18s;
    }
    li:nth-child(3) {
      transition-delay: .36s;
    }
    .why {
      display: block;
      margin: 10px 0;
      height: 100px;
      width: 100px;
      transform-origin: 50% 50%;
      transition: all 0.43s cubic-bezier(0.7, 0.3, 0, 1), transform 0.33s cubic-bezier(0.06, 0.63, 0.15, 1.4);
      background: url() center center no-repeat;
      background-size: cover;
      &:hover {
        transform: scale(1.07);
      }
      &::before {
        content: '';
        display: inline-block;
        height: 100%;
        vertical-align: middle;
        margin-right: -0.25em;
      }
      span {
        position: relative;
        z-index: 2;
        display: inline-block;
        vertical-align: middle;
        width: 84%;
        padding-left: 8%;
        text-align: center;
        font-size: 1.2em;
        line-height: 1.1em;
        transition: 0.18s;
        white-space: nowrap;
      }
    }
  }
  .main-nav {
    position: absolute;
    top: 50%;
    left: 30px;
    margin-top: -95px;
    > li {
      transition: .23s;
      &:nth-child(1) {
        a:hover {
          ul {
            li::before {
              transition: 0.22s cubic-bezier(0.38, -0.32, 0.89, 0.34) 0s;
              transform: translateX(0px);
              opacity: 0;
            }
            @for $i from 1 through 8 {
              li:nth-child(#{$i})::before {
                transition-delay: $i*0.02s;
              }
            }
            &::after {
              transition: 3s 0s, -webkit-clip-path 0.32s 0.3s;
              -webkit-clip-path: polygon(20.4% 65%, 56.4% 83%, 65.8% 16%);
              clip-path: polygon(20.4% 65%, 56.4% 83%, 65.8% 16%);
              transform: rotate(20deg);
            }
          }
          ul::before {
            transition-delay: 0.2s;
            transform: scale(0);
          }
        }
        ul::after {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          height: 30px;
          width: 30px;
          margin-top: -15px;
          margin-left: -15px;
          background-image: url();
          background-size: 10px 30px;
          transition: 0.22s;
          -webkit-clip-path: polygon(50% 50%, 50% 50%, 50% 50%);
          clip-path: polygon(50% 50%, 50% 50%, 50% 50%);
        }
      }
      &:nth-child(1) ul {
        position: relative;
        z-index: 999;
        top: 50%;
        left: 50%;
        &::before {
          height: 4px;
          width: 4px;
          margin-top: -2px;
          margin-left: -2px;
        }
        li {
          position: absolute;
          &::before {
            transform: translateX(10px);
          }

        }
        @for $i from 1 through 8 {
          li:nth-child(#{$i}) {
            transform: rotate($i*45deg);
          }
        }
        li::before, &::before {
          content: "";
          position: absolute;
          height: 2px;
          width: 2px;
          display: block;
          border-radius: 50px;
          margin-top: -1px;
          margin-left: -1px;
          background: url();
          background-size: 10px 30px;
          transition: 0.22s 0.14s;
        }
      }
      &:nth-child(2) {
        transition-delay: 0.18s;
        .arrow {
          transform: scale(0.45) rotate(-45deg);
          top: 26px;
          left: 31px;
          -webkit-font-smoothing: antialiased;
          transition: 0.2s cubic-bezier(0.62, 0.02, 0.34, 1);
          &::before {
            left: 1px;
          }
          &::after {
            left: -3px;
          }
          &::before, &::after {
            width: 17px;
            height: 6px;
            top: 2px;
          }
          div::before, div::after {
            content: "";
            position: absolute;
            top: 6px;
            left: 4px;
            width: 6px;
            height: 23px;
            background: url();
            background-size: 30px 70px;
            border-radius: 2px;
            transition: 0.2s cubic-bezier(0.62, 0.02, 0.34, 1);
          }
          div::after {
            transform: rotate(90deg);
            left: -1px;
            top: 20px;
            height: 15px;
          }
          &:nth-child(2) {
            top: 39px;
            left: 37px;
            transform: scale(0.45) rotate(135deg);
            transition: 0.2s cubic-bezier(0.62, 0.02, 0.34, 1);
          }
        }
        a:hover {
          .arrow {
            transform: scale(0.45) rotate(-135deg) translate3d(-12px, -18px, 0);
            &:nth-child(2) {
              transform: scale(0.45) rotate(45deg) translate3d(-9px, -20px, 0);
            }
          }
        }
        a.stop {
          .arrow {
            transform: scale(0.45) rotate(-90deg) translate3d(-12px, -18px, 0);
            transition-delay: 0.07s;
            &::before, &::after {
              opacity: 0;
            }
            div::before {
              top: 7px;
              left: 5px;
              width: 11px;
              height: 35px;
            }
            div::after {
              top: 23px;
              left: -7px;
              width: 11px;
              height: 32px;
            }
          }
          .arrow:nth-child(2) {
            transform: scale(0.45) rotate(90deg) translate3d(-9px, -20px, 0);
          }
          &::after {
            transform: scale(0);
          }
        }
      }
      &:nth-child(3) {
        &.muted {
          .mute span {
            width: 22px;
            transition: 0.23s cubic-bezier(0.62, 0.02, 0.34, 1), border 0.14s;
            opacity: 1;
          }
          .mute::before, .mute::after {
            opacity: .37;
          }
        }
        transition-delay: 0.36s;
        .mute {
          position: relative;
          z-index: 9;
          height: 100%;
          width: 100%;
          &::before, &::after {
            content: "";
            position: absolute;
            height: 100%;
            width: 100%;
            background: url() no-repeat center center;
            background-size: 15px 22px;
            transition: 0.24s;
          }
          &::after {
            background: url() no-repeat center center;
            background-size: 15px 22px;
            transition-delay: 0.11s;
          }
          span {
            position: absolute;
            right: 50%;
            height: 2px;
            width: 0;
            border-radius: 7px;
            border: 2px solid #181818;
            z-index: 2;
            opacity: 0;
            background: url();
            background-size: 80px 60px;
            transform: translate3d(11px, 14px, 0) rotate(-45deg);
            transform-origin: 100% 50%;
            transition: 0.22s, opacity 0.1s 0.1s;
          }
        }
      }
    }
    .popout {
      right: auto;
      left: 80px;
      transform: translateX(-8px);
    }
    .all-animals-off-btn {
      position: absolute;
      top: 50%;
      margin-top: -27px;
      opacity: 0;
      transition: 0.23s;
      transform: translateX(-11px);
      pointer-events: none;
      &.active {
        opacity: 1;
        pointer-events: auto;
      }
    }
  }
  .animal-info {
    position: fixed;
    width: 100%;
    top: 50%;
    margin-top: 13%;
    transition: 0.18s 0.3s;
    text-align: center;
    li {
      position: relative;
      display: inline-block;
      height: 40px;
      margin-top: 0;
      margin-right: 16px;
      transition: 0.23s;
      transform: translateY(0);
    }
    li:nth-child(1) {
      margin-right: 32px;
      letter-spacing: .1em;
      opacity: .77;
      &::before {
        content: "";
        position: absolute;
        right: -16px;
        top: 0;
        height: 100%;
        width: 3px;
        border-radius: 10px;
        background-color: #486461;
      }
      span {
        display: block;
        font-size: 18px;
      }
    }
    li:nth-child(2) {
      transition-delay: .13s;
      line-height: 44px;
      h2 {
        font-size: 46px;
        color: #fff;
        margin-top: -4px;
        font-weight: 500;
      }
    }
    li:nth-child(3) {
      margin-right: 0;
      transition-delay: .22s;
      a {
        position: relative;
        float: left;
        height: 44px;
        width: 44px;
        margin-right: 5px;
      }
      a.direct-stats {
        transition: 0.3s 0.32s;
        background: url(../img/green-texture-circle.png) center center repeat;
        background-size: cover;
      }
      a.wallpaper {
        background: url(../img/green-texture-circle.png) center center repeat;
        background-size: cover;
        margin-right: 0;
        &:hover {
          span {
            height: 0;
            width: 0;
            border: 4px solid #FFF !important;
            transform: translateX(4px);
            &::before {
              transform: rotate(45deg) translateX(0px) translateY(12px);
            }
            &::after {
              transform: rotate(-45deg) translateX(-8px) translateY(4px);
              opacity: 1;
            }
          }
        }
        span {
          position: absolute;
          top: 50%;
          left: 50%;
          z-index: 99;
          height: 13px;
          width: 13px;
          margin-left: -8px;
          margin-top: -8px;
          transition: 0.18s;
          border: 2px solid #fff;
          border-radius: 4px;
          -webkit-backface-visibility: hidden;
          &::before, &::after {
            content: "";
            position: absolute;
            top: 0;
            left: 50%;
            width: 11px;
            height: 2px;
            border-radius: 3px;
            background: white;
            transition: 0.18s;
            transform-origin: 50% 50%;
            transform: rotate(-45deg) translateX(-8px) translateY(0px);
          }
          &::after {
            opacity: 0;
          }
        }
      }
    }
    &.text-change {
      li, a:nth-child(2) {
        opacity: 0;
        transition: 0.15s;
        transform: translateY(5px);
      }
      li:nth-child(2), li:nth-child(3), li:nth-child(3) a:nth-child(2) {
        transition-delay: 0s;
      }
    }
  }
}

.stats-pie {
  &:hover {
    span {
      border-color: #fff !important;
      transition: 0.22s;
      &::before {
        background-color: #fff !important;
      }
    }
  }
  span {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 15px;
    width: 15px;
    margin: -10px 0 0 -9px;
    border: 2px solid #fff;
    border-radius: 20px;
    transition: 0.18s;
    transform-origin: 50% 50%;
    animation: pie-rotations 5s infinite forwards;
    &::before {
      content: "";
      position: absolute;
      top: -20%;
      left: -20%;
      height: 120%;
      width: 120%;
      border-radius: 20px;
      background-color: #FFF;
      -webkit-clip-path: polygon(9% 35%, 22% 23%, 40% 13%, 60% 9%, 70% 9%, 58% 58%);
      clip-path: polygon(9% 35%, 22% 23%, 40% 13%, 60% 9%, 70% 9%, 58% 58%);
      transition: 0.18s;
    }
  }
}

.all-animals .main-nav .all-animals-off-btn {
  transition-delay: 0.54s;
  opacity: 1;
  transform: translateX(0px);
  pointer-events: auto;
}
.nav-btn {
  display: block;
  position: relative;
  height: 54px;
  width: 54px;
  border-radius: 50%;
  transition: .14s;
  margin-bottom: 10px;
  background: url('');
  &.close {
    position: relative;
    display: block;
    margin: 0 auto;
    background: url() repeat center center/40px 40px;
    &:hover {
      .icon::before {
        transform: rotate(-135deg);
        transition-delay: 0.1s;
      }
      .icon::after {
        transform: rotate(135deg);
      }
    }
    .icon {
      position: absolute;
      top: 50%;
      left: 50%;
      z-index: 99;
      margin-left: -12px;
      margin-top: -4px;
      transition: 0.18s 0.1s;
      &::before {
        transform: rotate(45deg);
      }
      &::after {
        transform: rotate(-45deg);
      }
      &::after, &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 25px;
        height: 7px;
        border-radius: 2px;
        background: url();
        background-size: 30px 30px;
        transition: 0.3s;
        transform-origin: 50% 50%;
      }
    }
  }
  &:hover {
    transform: scale(1.07);
    .arrow {
      transform: translateY(-2px);
    }
    .popout {
      transform: translateX(0) !important;
      opacity: 1;
    }
    &::after {
      transform: scale(0.94);
    }
  }
  &::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #64d6e2;
    width: 44px;
    height: 44px;
    border-radius: 100px;
    background-size: 120%;
    transition: 0.14s;
  }
  .arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 99;
    margin-left: -7px;
    margin-top: -5px;
    transition: .18s .1s;
    &::before {
      transform: rotate(45deg);
    }
    &::after {
      transform: rotate(-45deg);
    }
    &::before, &::after {
      content: '';
      position: absolute;
      width: 15px;
      height: 7px;
      border-radius: 2px;
      background-image: url();
      background-size: 30px 30px;
      transition: .3s;
      transform-origin: 50% 100%;
    }
  }
  .popout {
    position: absolute;
    right: 80px;
    top: 6px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
  }
}
.popout {
  padding: 12px 2px;
  line-height: 1.7em;
  background: url() repeat-x left center;
  background-size: 85px 36px;
  transition: .18s;
  white-space: nowrap;
  font-size: 14px;
  color: #1b1b1c;
  &::before {
    left: -23px;
    background: url() no-repeat center center;
    background-size: 20px 36px;
  }
  &::after {
    right: -23px;
    background: url() no-repeat center center;
    background-size: 20px 36px;
  }
  &::before, &::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 30px;
    z-index: -1;
  }
}

footer {
  position: absolute;
  bottom: 30px;
  z-index: 999;
  width: 100%;
  ul {
    position: relative;
    top: 0;
    text-align: center;
    li {
      position: relative;
      display: inline-block;
      margin: 0 15px;
      font-size: 14px;
      transition: 0.27s;
      transform: translateY(0);
      @for $i from 1 through 5 {
        &:nth-child(#{$i}) {
          transition-delay: $i*.14s;
        }
      }
      .share {
        padding-left: 34px;
        background: url() left center no-repeat;
        background-size: 23px 15px;
      }
      .popout {
        position: relative;
        top: -2px;
        font-size: 1em;
        letter-spacing: .09em;
        background-size: 80px 34px;
        transition: 0.26s cubic-bezier(0.62, 0.02, 0.34, 1);
        &:hover {
          padding-left: 94px;
          .wee {
            opacity: 1;
            transition: 0.26s 0.1s;
          }
        }
        .wee {
          position: absolute;
          left: 0;
          top: 9px;
          opacity: 0;
          transition: 0.2s;
        }
        .bryan {
          letter-spacing: .08em;
        }
        &::before, &::after {
          background-size: 20px 34px;
        }
      }
    }
  }
}

.line-link {
  position: relative;
  &:hover {
    &::after {
      opacity: 1;
      transform: translateY(0);
    }
  }
  &::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    height: 2px;
    width: 100%;
    background: url() repeat left center;
    background-size: 40px 30px;
    border-radius: 40px;
    opacity: 0;
    transform: translateY(2px);
    transition: 0.19s;
  }
}


.preloader-layer {
  .nav {
    pointer-events: none;
  }
  .footer-nav {
    pointer-events: none;
    opacity: 0;
  }
  .animal-nav {
    li {
      transition: .23s ease-in;
      opacity: 0;
      transform: translateX(11px);
      pointer-events: none;
    }
  }
  .main-nav {
    li {
      transition: .23s ease-in;
      opacity: 0;
      transform: translateX(-11px);
      pointer-events: none;
    }

  }
  .animal-info {
    transition: .2s ease-in 0s;
    opacity: 0;
    transform: translateY(11px);
  }
  footer {
    pointer-events: none;
    ul li {
      opacity: 0;
      transform: translateY(4px);
    }
  }
}
.nav {
  footer {
    .footer-nav {
      display: none;
    }
  }
}
